package cn.gson.springboot.model.pjos;

import javax.persistence.*;
import java.math.BigDecimal;
import java.sql.Date;
import java.util.Objects;

@Entity
public class Outboundorder {
    private int outId;//发货单id
    private Integer outorderId;//需要出库的订单编号
    private Date outTime;//发货时间
    private Integer outState;//发货状态
    private Integer outWay;//发货方式
    private Integer outuserId;//负责人
    private BigDecimal outPrice;//运费
    private String outCourier;//快递单号3
    private Deliveryplan deliveryplanByDeliveryId;//交付计划编号

    @Id
    @Column(name = "out_id")
    @GeneratedValue(strategy = GenerationType.IDENTITY,generator = "seq")
    public int getOutId() {
        return outId;
    }

    public void setOutId(int outId) {
        this.outId = outId;
    }

    @Basic
    @Column(name = "outorder_id")
    public Integer getOutorderId() {
        return outorderId;
    }

    public void setOutorderId(Integer outorderId) {
        this.outorderId = outorderId;
    }

    @Basic
    @Column(name = "out_time")
    public Date getOutTime() {
        return outTime;
    }

    public void setOutTime(Date outTime) {
        this.outTime = outTime;
    }

    @Basic
    @Column(name = "out_state")
    public Integer getOutState() {
        return outState;
    }

    public void setOutState(Integer outState) {
        this.outState = outState;
    }

    @Basic
    @Column(name = "out_way")
    public Integer getOutWay() {
        return outWay;
    }

    public void setOutWay(Integer outWay) {
        this.outWay = outWay;
    }

    @Basic
    @Column(name = "outuser_id")
    public Integer getOutuserId() {
        return outuserId;
    }

    public void setOutuserId(Integer outuserId) {
        this.outuserId = outuserId;
    }

    @Basic
    @Column(name = "out_price")
    public BigDecimal getOutPrice() {
        return outPrice;
    }

    public void setOutPrice(BigDecimal outPrice) {
        this.outPrice = outPrice;
    }

    @Basic
    @Column(name = "out_courier")
    public String getOutCourier() {
        return outCourier;
    }

    public void setOutCourier(String outCourier) {
        this.outCourier = outCourier;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Outboundorder that = (Outboundorder) o;
        return outId == that.outId &&
                Objects.equals(outorderId, that.outorderId) &&
                Objects.equals(outTime, that.outTime) &&
                Objects.equals(outState, that.outState) &&
                Objects.equals(outWay, that.outWay) &&
                Objects.equals(outuserId, that.outuserId) &&
                Objects.equals(outPrice, that.outPrice) &&
                Objects.equals(outCourier, that.outCourier);
    }

    @Override
    public int hashCode() {
        return Objects.hash(outId, outorderId, outTime, outState, outWay, outuserId, outPrice, outCourier);
    }

    @ManyToOne
    @JoinColumn(name = "delivery_id", referencedColumnName = "delivery_id")
    public Deliveryplan getDeliveryplanByDeliveryId() {
        return deliveryplanByDeliveryId;
    }

    public void setDeliveryplanByDeliveryId(Deliveryplan deliveryplanByDeliveryId) {
        this.deliveryplanByDeliveryId = deliveryplanByDeliveryId;
    }
}
